//
//  SPSubStreamInfo.m
//  SuperPlayer
//
//  Created by Steven Choi on 2020/2/11.
//  Copyright © 2020 annidy. All rights reserved.
//

#import "SPSubStreamInfo.h"
#import "CTSuperPlayerUtil.h"

@implementation SPSubStreamInfo

+ (instancetype)infoWithDictionary:(NSDictionary *)dict {
    SPSubStreamInfo *info = [[SPSubStreamInfo alloc] init];
    double width = [CTSuperPlayerUtil parseDoubleValue:dict[@"width"]];
    double height = [CTSuperPlayerUtil parseDoubleValue:dict[@"height"]];
    info.size = CGSizeMake(width, height);
    info.resolutionName =  [CTSuperPlayerUtil parseStringValue:dict[@"name"]];
    info.type = [CTSuperPlayerUtil parseStringValue:dict[@"type"]];
    return info;
}

@end
